{include file="public/_meta" /}
<title></title>
<style type="text/css">
.inp {
width: 150px;
height: 25px;
}
.inp:focus {
outline:none;
border: 1px solid red;
}
</style>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>会员管理 <span class="c-gray en">&gt;</span> 会员列表 
	<!-- <a class="btn btn-success radius r" style="line-height:1.5em;margin-top:3px" href="javascript:void(0);" onclick="downdo()" title="下载" ><i class="Hui-iconfont">&#xe640;</i></a>&nbsp;&nbsp; -->
	<a class="btn btn-success radius r" style="line-height:1.5em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
<!--	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px;margin-right:6px " onclick="excel()" title="导出"><i class="Hui-iconfont">&#xe644;</i></a>-->
</nav>
<div class="page-container">
	<div class="text-c">
	<form class="Huiform" method="get" action="" target="_self">

		余额排序：
		<span class="select-box inline">
			<select name="over_sort" class="select">
				<option value="">排序</option>
				<option value="1">倒叙</option>
				<option value="2">正序</option>
				<!--<option value="3" style="color:red;">被禁用</option>-->
			</select>
		</span>&nbsp;
		<input type="text" class="input-text" style="width:300px" placeholder="用户手机号、ID号、用于查询直推用户信息" id="" name="tel_id" value="{$Request.get.tel_id|default=''}">
		会员角色：
		<span class="select-box inline">
			<select name="us_type" class="select">
				<option value="">全部</option>
				<option value="1">会员</option>
				<option value="2">店长</option>
				<option value="3">运营中心</option>
			</select>
		</span>&nbsp;

		<input type="text" class="input-text" style="width:70px" placeholder="ID号" id="" name="id" value="{$Request.get.id|default=''}">
		<input type="text" class="input-text" style="width:150px" placeholder="用户昵称、账号、手机号" id="" name="keywords" value="{$Request.get.keywords|default=''}">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l" style="margin: 10px">
			<a href="javascript:;" onclick="create(0,'add','添加会员')" class="btn btn-primary radius">
			<i class="Hui-iconfont">&#xe600;</i> 新增会员</a>
		</span>
		<span class="r" style="margin: 10px">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
	<div class="mt-20">
	<table class="table table-border  table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">				
				<th>ID</th>
				<th>推荐人账户</th>
				<th>昵称</th>
				<th>手机号</th>
				<th>身份证号</th>
				<th>会员等级</th>
				<th>可用余额</th>
				<th>冻结余额</th>
				<!-- <th>商品分类</th> -->
				<td>直推数量</td>
				<th>我的团队</th>
				<th>收益明细</th>
<!--				<th>充值</th>-->
				<!-- <th>特惠专区提成奖金</th> -->
				<!-- <th>结算法</th> -->
				<th>状态</th>
				<th>添加时间</th>
				<th>最后登录时间</th>
<!--				<th>重置密码</th>-->
				<!-- <th>激活会员</th> -->
				<th>操作</th>
			</tr>
		</thead>
		<tbody id="removle">
			{foreach $list as $vo}
				<tr class="text-c">
					<td>{$vo.id}</td>
					<td><a href="javascript:;" onclick="submit({$vo.id})">{$vo.us_pid_tel}</a></td>
					<td>{$vo.us_nickname}</td>
					<!--					<td>{$vo.us_account}</td>-->
					<td>{$vo.us_tel}</td>
					<td>{$vo.us_id_card}</td>


					<td><select onchange="changeUsType({$vo.id},$(this).val(),'us_type')">

						<option value="1" {if condition="$vo.us_type eq 1"}selected{/if}>会员</option>
						<option value="2" {if condition="$vo.us_type eq 2"}selected{/if}>店长</option>
						<option value="3" {if condition="$vo.us_type eq 3"}selected{/if}>运营中心</option>
					</select>
					</td>

					<td>{$vo.us_all_get}</td>
					<td>{$vo.us_all_two_money}</td>
					<td>{$vo.us_pid_num}</td>

					<td><a href="javascript:;" onclick="showMyteam({$vo.id})">[点击查看]</a></td>
					<td><a href="javascript:;" onclick="myAccount({$vo.id})">[点击查看]</a></td>
<!--					<td><a href="javascript:;" onclick="create({$vo.id},'addmoney','会员充值')">[点击充值]</a></td>		-->
					<td class="td-status">
					{if condition="$vo.us_status eq 1"}
						<a style="text-decoration:none" onClick="change({$vo.id},0,'us_status')" href="javascript:;" title="停用"><span class="label label-success radius">已启用</span></a>
					{else/}
						<a style="text-decoration:none" onClick="change({$vo.id},1,'us_status')" href="javascript:;" title="启用"><span class="label label-default radius">已禁用</span></a>
					{/if}
					</td>
					<td>{$vo.us_add_time}</td>
					<td>{$vo.zuihou_time}</td>
<!--					<td class="td-manage">-->
<!--						<a style="text-decoration:none" onclick="repwd({$vo.id})" title="重置密码"><i class="Hui-iconfont">[点击重置]</i></a>-->

					<td class="td-manage">					
						<!-- <a style="text-decoration:none" onclick="record({$vo.id},'edit','会员详情')"  title="会员详情"><i class="Hui-iconfont">&#xe6c6;</i></a> -->
					<!-- 	{if condition="$vo.us_status eq 1"}
						<a style="text-decoration:none" onClick="change({$vo.id},0,'us_status')" href="javascript:;" title="停用"><i class="Hui-iconfont">&#xe631;</i></a>
						{else/}
						<a onClick="change({$vo.id},1,'us_status')" href="javascript:;" title="启用" style="text-decoration:none"><i class="Hui-iconfont">&#xe615;</i></a>
						{/if} -->
						<a title="编辑" href="javascript:;" onclick="create({$vo.id},'edit','修改用户')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
						<!-- <a style="text-decoration:none" onclick="create({$vo.id},'addr','地址列表')" title="地址"><i class="Hui-iconfont">&#xe671;</i></a> -->
<!--						<a style="text-decoration:none" onclick="del({$vo.id})" title="删除"><i class="Hui-iconfont">&#xe706;</i></a>-->
					</td>
				</tr>
			{/foreach}
			</form>
		</tbody>
	</table>
	<div class="pages" style="margin:20px;float: right; ">{$list|raw}</div>
</div>
{include file="public/_footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
$('select[name="us_status"]').val({$Request.get.us_status});
$('select[name="gave_status"]').val({$Request.get.gave_status});


function create(id,url,key){
	var url = "{:url('"+url+"')}?id="+id;
	creatIframe(url,key);
}

function submit(id){
	console.log(id);
	location.href = '{:url(\'User/index\')}?userid='+id;
}

ptel = function (id) {
	$.ajax({
		type: "post",
		url: "{:url('index')}",
		data: {userid:id},
		success: function(data) {
			// var html=$('#removle');
			// html.remove();
			// console.log(html);
			// if(data.code){
			//
			// 	location.href = '';
			// }
		}
	});
}



function changeUsType(id,value,key){
	layer.confirm('确定要更改么？', {
		btn: ['确定', '取消']
	}, function(index, layero){
		$.ajax({
			type: "post",
			url: "{:url('changeUsType')}",
			data: {id:id,value:value,key:key},
			success: function(data) {
				if(data.code){
					location.href = '';
				}
			}
		});
	});
}

function change(id,value,key){
	layer.confirm('确定要更改么？', {
	      btn: ['确定', '取消']
	    }, function(index, layero){
	        $.ajax({
	            type: "post",
	            url: "{:url('change')}",
	            data: {id:id,value:value,key:key},
	            success: function(data) {
	             	if(data.code){
	             		location.href = '';
	             	}
	            }
	        });
	    });
}
function repwd(id){
	layer.confirm('确定要重置么？重置后密码为123456', {
	      btn: ['确定', '取消']
	    }, function(index, layero){
	        $.ajax({
	            type: "post",
	            url: "{:url('repwd')}",
	            data: {id:id},
	            success: function(data) {
	            	layer.msg(data.msg);
	             	if(data.code){
	             		setTimeout("window.location='';",1000);
	             		//location.href = '';
	             	}
	            }
	        });
	    });
}
function settle(id){
	layer.confirm('确定要结算么？', {
	      btn: ['确定', '取消']
	    }, function(){
	        $.ajax({
	            type: "post",
	            url: "{:url('settle')}",
	            data: {id:id},
	            async:true,
	            success: function(data) {
	             	if(data.code){
	             		layer.msg(data.msg);
	             		setTimeout("window.location='';",500);
	             	}
	            }
	        });
	    });
}

function del(id){
    layer.confirm('确定要删除么？', {
      btn: ['确定', '取消']
    }, function(index, layero){
        $.ajax({
            type: "post",
            url: "{:url('delete')}",
            data: {id:id},
            success: function(data) {            	
                layer.msg(data.msg);
                setTimeout("window.location=\"{:url('User/index')}\"",500);
            }
        });
    });
}
function activate(id){
	var url = "{:url('User/activate')}?id="+id;
	layer_show('激活会员',url,'600','300');
}	
function myAccount(id){
	var url = "{:url('User/myAccount')}?id="+id;
	layer_show('收益明细',url);
}

function roleChange(id){
	var url = "{:url('User/roleChange')}?id="+id;
	layer_show('角色更改',url);
}



function showMyteam(id){
	var url = "{:url('showMyteam')}?id="+id;
	layer_show('我的团队',url);
	//layer_show('发货页面',url,'600','300');
}
function excel(){
    var url = "{:url('excel')}";
    creatIframe(url,'表格导出');
}
</script> 
</body>
</html>